﻿#include<stdio.h>
#include<Windows.h>
#include<stdlib.h>
#include<time.h>
#include<stdbool.h>
#include<wchar.h>
enum direction
{
	UP=1,
	DOWN,
	LEFT,
	RIGHT
};
enum gamestate
{
	OK = 1,
	FASTER,
	LOWER,
	ENDNORMAL,
	Kill_Byself,
	Kill_By_Wall
};
typedef struct SnakeNode
{
	//蛇蛇属性
	int x;
	int y;
	struct SnakeNode* next;
}SnakeNode;
typedef SnakeNode* pSnakeNode;
typedef struct Snake
{
	pSnakeNode ps;
	pSnakeNode _food;//食物
	enum direction dir;
	enum gamestate state;
	float score;
	int Foodscore;
	int Sleeptime;
}Snake;
typedef Snake* pSnake;
void SetPos(short x, short y);
void EatFood(pSnake sn, pSnakeNode snext);
void NormalMove(pSnake sn, pSnakeNode snext);